package com.example.wechat.model;

import java.util.Date;

import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import com.example.project.annotation.Excel;
import com.example.project.core.domain.BaseEntity;
import com.fasterxml.jackson.annotation.JsonFormat;

/**
 * 会话成员关系对象 t_wechat_conversation_members
 * 
 * @author ruoyi
 * @date 2025-11-12
 */
public class WechatConversationMember extends BaseEntity {

	private static final long serialVersionUID = 1L;

	/** 记录ID，主键 */
	private Long id;

	/** 会话ID */
	@Excel(name = "会话ID")
	private Long conversationId;

	/** 成员用户ID */
	@Excel(name = "成员用户ID")
	private Long userId;

	/** 成员角色：0-普通成员 1-管理员 2-群主 */
	@Excel(name = "成员角色：0-普通成员 1-管理员 2-群主")
	private Long role;

	/** 加入会话时间 */
	@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
	@Excel(name = "加入会话时间", width = 30, dateFormat = "yyyy-MM-dd")
	private Date joinedAt;

	/** 最后阅读的消息ID */
	@Excel(name = "最后阅读的消息ID")
	private Long lastReadMessageId;

	public void setId(Long id) {
		this.id = id;
	}

	public Long getId() {
		return id;
	}

	public void setConversationId(Long conversationId) {
		this.conversationId = conversationId;
	}

	public Long getConversationId() {
		return conversationId;
	}

	public void setUserId(Long userId) {
		this.userId = userId;
	}

	public Long getUserId() {
		return userId;
	}

	public void setRole(Long role) {
		this.role = role;
	}

	public Long getRole() {
		return role;
	}

	public void setJoinedAt(Date joinedAt) {
		this.joinedAt = joinedAt;
	}

	public Date getJoinedAt() {
		return joinedAt;
	}

	public void setLastReadMessageId(Long lastReadMessageId) {
		this.lastReadMessageId = lastReadMessageId;
	}

	public Long getLastReadMessageId() {
		return lastReadMessageId;
	}

	@Override
	public String toString() {
		return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE).append("id", getId())
				.append("conversationId", getConversationId()).append("userId", getUserId()).append("role", getRole())
				.append("joinedAt", getJoinedAt()).append("lastReadMessageId", getLastReadMessageId()).toString();
	}
}
